<template>
	<view class="control-page">
		<framelayout>
			<uni-forms slot='configure' ref="form" :modelValue="data" label-width='25%' class='form'>
				<uni-forms-item label="avatar" required>
					<uni-file-picker @success="onsuccess" v-model="data.avatar" @fail="onfail" limit="1"
						title="最多选择1张图片"></uni-file-picker>
				</uni-forms-item>
				<uni-forms-item label="level" required>
					<uni-easyinput type="number" v-model="data.level" placeholder="请输入等级" />
				</uni-forms-item>
				<uni-forms-item label="name" required>
					<uni-easyinput type="text" v-model="data.name" placeholder="请输入用户名" />
				</uni-forms-item>
				<uni-forms-item label="credit" required>
					<uni-easyinput type="number" v-model="data.credit" placeholder="请输入信用分" />
				</uni-forms-item>
				<uni-forms-item label="wordOfMouth" required>
					<uni-easyinput type="number" v-model="data.wordOfMouth" placeholder="请输入口碑分" />
				</uni-forms-item>
				<uni-forms-item label="performance" required>
					<uni-easyinput type="number" v-model="data.performance" placeholder="请输入履约分" />
				</uni-forms-item>
				<uni-forms-item label="paymentAmount" required>
					<uni-easyinput type="number" v-model="data.paymentAmount" placeholder="请输入支付金额" />
				</uni-forms-item>
				<uni-forms-item label="payForOrders" required>
					<uni-easyinput type="number" v-model="data.payForOrders" placeholder="请输入支付订单" />
				</uni-forms-item>
				<uni-forms-item label="numberOfTransactions" required>
					<uni-easyinput type="number" v-model="data.numberOfTransactions" placeholder="请输入成交人数" />
				</uni-forms-item>
				<uni-forms-item label="realTimeDeals" required>
					<uni-easyinput type="text" v-model="data.realTimeDeals" placeholder="请输入实时成交" />
				</uni-forms-item>
				<uni-forms-item label="closedLastWeek" required>
					<uni-easyinput type="text" v-model="data.closedLastWeek" placeholder="请输入上周成交" />
				</uni-forms-item>
				<u-button text="提交" :customStyle="{width:'80px'}" type="primary" @click="submit"></u-button>
			</uni-forms>
			<window slot='preview' :configureData='data' :isDisplay='true'></window>
		</framelayout>
	</view>
</template>

<script>
	import framelayout from "./framelayout.vue"
	import window from "@/pages/window/window.vue"
	import {
		dataBaseMixin
	} from "@/mixins/dataBaseMixin.js"
	export default {
		mixins: [dataBaseMixin],
		components: {
			framelayout,
			window,
		},
		data() {
			return {
				data: {}
			}
		},
		mounted() {
			this.getData('windowData')
		},
		methods: {
			// 提交
			submit() {
				this.updateData('windowData')
			},
		},
	}
</script>

<style lang="scss" scoped>
	.control-page {
		.form {
			padding: 10px;
		}

		::v-deep .uni-forms-item__content {
			display: flex;
			flex-wrap: wrap;
		}

		.img {
			max-width: 100px;
		}
	}
</style>
